Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL] Refactor vector_arith* #16349

Merged
merged 15 commits into from
Dec 16, 2024

Conversation

aelovikov-intel
Copy link
Contributor

This PR separates the "base" case functional implementation from templates/overloads/constraints. The latter doesn't match even the current SYCL spec and that is not taking into account proposed vec/swizzle changes.

Making this change would allow to share more code between non-preview/preview implementation paths when implementing proposed SYCL vec/swizzle changes.

This PR separates the "base" case functional implementation from
templates/overloads/constraints. The latter doesn't match even the
current SYCL spec and that is not taking into account proposed
vec/swizzle changes.

Making this change would allow to share more code between
non-preview/preview implementation paths when implementing proposed SYCL
vec/swizzle changes.
std::is_same_v<element_type, ext::oneapi::bfloat16>) {
result_t res{};
for (size_t i = 0; i < N; ++i)
if constexpr (is_logical)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you remind me why we are using -1 on the logical ops here? Or maybe insert a comment?

Copy link
Contributor Author

@aelovikov-intel aelovikov-intel Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because that's how it's defined in the SYCL spec... ¯\(ツ)

I'm doing some minor changes here to unify several code paths and fix some CTS failures.

for (size_t I = 0; I < NumElements; ++I) {
Ret[I] = bit_cast<int8_t>(Ret[I]) != 0;
}
return VecOperators::apply_unary_op<std::bit_not<void>>(Rhs);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omg, if true, I love this. Stupid operator~ was as huge pain. we need to make sure it's fully tested, lin/win , bool, std::byte (and not applicable to float IIRC).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm running local CTS (bin/test_vector* tests) in addition to pre-commit CI.

Copy link
Contributor

@uditagarwal97 uditagarwal97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ❤️

@aelovikov-intel aelovikov-intel merged commit 746a2bd into intel:sycl Dec 16, 2024
14 checks passed
@aelovikov-intel aelovikov-intel deleted the refactor-vec-arith branch December 16, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants